package com.ksc.wordcount.task.reduce;

import com.ksc.wordcount.datasourceapi.PartionWriter;
import com.ksc.wordcount.shuffle.ShuffleBlockId;
import com.ksc.wordcount.task.TaskContext;

public class MiddleReduceContext extends TaskContext {

    ShuffleBlockId[] shuffleBlockId;
    //String destDir;
    ReduceFunction reduceFunction;
    PartionWriter partionWriter;

    int reduceTaskNum;

    public MiddleReduceContext(String applicationId,
                               String stageId,
                               int taskId,
                               int partionId,
                               ShuffleBlockId[] shuffleBlockId,
                               ReduceFunction reduceFunction,
                               PartionWriter partionWriter,
                               int reduceTaskNum) {
        super(applicationId, stageId, taskId, partionId);
        this.shuffleBlockId = shuffleBlockId;
        //this.destDir = destDir;
        this.reduceFunction = reduceFunction;
        this.partionWriter = partionWriter;
        this.reduceTaskNum=reduceTaskNum;
    }

    public ShuffleBlockId[] getShuffleBlockId() {
        return shuffleBlockId;
    }


    public ReduceFunction getReduceFunction() {
        return reduceFunction;
    }

    public PartionWriter getPartionWriter() {
        return partionWriter;
    }

    // 获取Reduce任务数量
    public int getReduceTaskNum() {
        return reduceTaskNum;
    }


}
